<template>
  <div>
    <ul>
      <li v-for="(item,i) in arr1" :key="item" >{{item}} <button @click="del(i)">删除</button></li>
     
    </ul>
    <button @click="born">生成</button>

  </div>
</template>
<script>
export default {
  data() {
    return {
      arr1: []
    };
  },
  methods: {
    born() {
      this.arr1.push(parseInt(Math.random() * 10));
    },
    del(i) {
      this.arr1.splice(i, 1);
    }
  }
};
</script>
<style>
</style>